package com.uqpsoftware.uqplist;

public class TabList {
	private String mName;
	private final int mID;

	private final static String SPACER_SYMBOL = "__#___";

	public TabList(String reCreateListFromString) throws Exception {
		String[] subStrings = reCreateListFromString.split(SPACER_SYMBOL);
		if (subStrings.length != 2) {
			throw new Exception(
					"The string argument to list constructor was not formatted correctly!!!!");
		}
		mName = subStrings[0];
		mID = Integer.parseInt(subStrings[1]);
	}

	public TabList(String name, int ID) {
		mName = name;
		mID = ID;
	}

	public String getName() {
		return mName;
	}

	public void setName(String name) {
		mName = name;
	}

	public int getID() {
		return mID;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return mName + SPACER_SYMBOL + mID;
	}
}
